/*
 * Copyright 2012 Faculty of Informatics - Masaryk University.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package cz.muni.fi.pa165.creatures.services;

import cz.muni.fi.pa165.creatures.dto.web.PersonDTO;


/**
 * This service interface offers methods for implementing operations related to
 * {@link cz.muni.fi.pa165.creatures.model.web.Person}.
 *
 * @author xmiklos1
 */
public interface PersonService {

    /**
     * This method creates a {@link cz.muni.fi.pa165.creatures.model.web.Person}.
     *
     * @param person person to create
     * @return id of the created person
     */
    Long create(PersonDTO person);

    /**
     * This method removes a {@link cz.muni.fi.pa165.creatures.model.web.Person}.
     *
     * @param person person to remove
     */
    void remove(PersonDTO person);

    /**
     * This method updates a {@link cz.muni.fi.pa165.creatures.model.web.Person}.
     *
     * @param person person to update
     */
    void update(PersonDTO person);

    /**
     * This method gets person's DTO by its id.
     *
     * @param id id of a person to get
     * @return person of specified {@code id}
     */
    PersonDTO getById(Long id);

    /**
     * Gets person by its name.
     *
     * @param name name of a person to get
     * @return person of the specified name
     */
    PersonDTO getByName(String name);
}
